setStateDescription

open fun setStateDescription(@NonNull view: View, @Nullable stateDescription: CharSequence)(source)

Sets the state description of this node.

Note: Cannot be called from an android.accessibilityservice.AccessibilityService. This class is made immutable before being delivered to an AccessibilityService.

State refers to a frequently changing property of the View, such as an enabled/disabled state of a button or the audio level of a volume slider.

This should omit role or content. Role refers to the kind of user-interface element the View is, such as a Button or Checkbox. Content is the meaningful text and graphics that should be described by setContentDescription or android:contentDescription. It is expected that a content description mostly remains constant, while a state description updates from time to time.

Parameters

view

view for which to set the description.

stateDescription

the state description of this node.

See also

Throws

If called from an AccessibilityService.